package main

import (
	"fmt"
	"strconv"
)

func main()  {
	
	var str string = "true"
	var b bool

	//_用于忽略返回的错误信息
	b,_ = strconv.ParseBool(str)
	fmt.Printf("b type %T,b=%v\n",b,b)

	var str2 string = "1234"
	var n1 int64
	//10表示10进制，64表示int64
	n1,_ = strconv.ParseInt(str2,10,64)
	fmt.Printf("b type %T,b=%v\n",n1,n1)

	var str3 string = "1.23"
	var f1 float64
	f1,_ = strconv.ParseFloat(str3,64)
	fmt.Printf("b type %T,b=%v\n",f1,f1)
}
